scores = [85, 92, 78, 96, 88, 73, 91, 67, 89, 94, 56, 12, 59, 65, 45]


# 根据分数分析相关信息
def analysis_score_info(_list) -> dict:
    """根据分数列表，分析处，学生人数，总分，平均分，最高分，最低分，不及格人数，及格人数"""

    student_count = len(_list)
    total_score = sum(_list)
    max_score = max(_list)
    min_score = min(_list)
    average_score = total_score / student_count
    pass_count = len([item for item in _list if item > 60])
    fail_count = len([item for item in _list if item < 60])

    return {
        "count": student_count,
        "total_score": total_score,
        "max_score": max_score,
        "min_score": min_score,
        "average_score": average_score,
        "pass_count": pass_count,
        "fail_count": fail_count,
    }


new_dict = analysis_score_info(scores)
print(new_dict)
